package cn.luzhangduo.studentsystemproject.model;

import java.util.Objects;

public class Agent {
    private int id;
    private String name;
    private String level;
    private String idCard;
    private String career;
    private String zoneName;

    public Agent(){

    }
    public Agent(String name, String level, String idCard, String career) {
        this.name = name;
        this.level = level;
        this.idCard = idCard;
        this.career = career;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getidCard() {
        return idCard;
    }

    public void setidCard(String idCard) {
        this.idCard = idCard;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }
    public String getSex(){
        return idCard.charAt(16)%2==0?"女":"男";
    }

    public String getZoneName() {
        return zoneName;
    }

    public void setZoneName(String zoneName) {
        this.zoneName = zoneName;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Agent agent = (Agent) o;
        return id == agent.id && Objects.equals(name, agent.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name);
    }

    @Override
    public String toString() {
        return "Agent{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", level='" + level + '\'' +
                ", idCard='" + idCard + '\'' +
                ", career='" + career + '\'' +
                '}';
    }
}
